<%@ Page language="c#" Codebehind="UploadFileManager.aspx.cs" AutoEventWireup="false" Inherits="TienTeTuong.UploadFileManager" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>Tien Te Tuong File Upload Manager</title>
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
        <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script>
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
        <script language="javascript">
            SelectThis = function (fn) {
                if (window.opener && !window.opener.closed)
                    $(window.opener.document.getElementsByName("value_Image")[0]).val('\\images\\upload\\' + fn);
                else
                    alert("You must call this windows from Add or Edit Article, Category or Detail category!");
                window.close();
            }
        </script>
	</HEAD>
	<body MS_POSITIONING="GridLayout" bgcolor="#ffffff">
		<form id="DemoFileManager" method="post" runat="server">
			<TABLE id="Table1" style="Z-INDEX: 101; LEFT: 8px; WIDTH: 744px; POSITION: absolute; TOP: 8px; HEIGHT: 459px" cellSpacing="1" cellPadding="1" width="744" align="center" border="0" bgcolor="#cccccc">
				<TR vAlign="top">
					<TD style="HEIGHT: 535px">
						<TABLE id="Table2" style="WIDTH: 672px; HEIGHT: 211px" height="211" cellSpacing="1" cellPadding="1" width="672" align="center" border="0">
							<TR>
								<TD width="43" height="2"></TD>
								<TD colSpan="2" vAlign="center" borderColor="black" align="middle" rowSpan="1" nowrap>
									<P><FONT color="#ff0099" size="5"><STRONG>File Upload Manager</STRONG></FONT></P>
									<P><STRONG><FONT color="#ff0099" size="5"></FONT></STRONG>&nbsp;</P>
									<P><STRONG><FONT color="#ff0099" size="5"></FONT></STRONG>&nbsp;</P>
								</TD>
								<TD width="19" height="2"></TD>
							</TR>
							<TR style="display:none">
								<TD style="HEIGHT: 29px"></TD>
								<TD style="WIDTH: 599px; HEIGHT: 29px" width="599"><STRONG>Enter Directory Name: </STRONG>
									<asp:textbox id="directory_text" runat="server"></asp:textbox><asp:button id="directory_btn" runat="server" Text="Create New Directory" CssClass="ButtonClass1"></asp:button></TD>
								<TD style="WIDTH: 94px; HEIGHT: 29px" width="134"></TD>
								<TD style="HEIGHT: 29px"></TD>
							</TR>
							<TR>
								<TD style="HEIGHT: 31px"></TD>
								<TD style="WIDTH: 599px; HEIGHT: 31px"><STRONG>Select File For UpLoad :</STRONG><INPUT id="File1" type="file" name="File1" runat="server"><asp:button id="upload_btn" runat="server" CssClass="ButtonClass1" Text="Upload File" Width="78px"></asp:button></TD>
								<TD style="WIDTH: 94px; HEIGHT: 31px"></TD>
								<TD style="HEIGHT: 31px"></TD>
							</TR>
							<TR>
								<TD style="HEIGHT: 30px"></TD>
								<TD style="WIDTH: 599px; HEIGHT: 30px"><STRONG>Delete File / Directory</STRONG>
									<asp:Button id="Button1" runat="server" Text="Delete" Width="108px" CssClass="ButtonClass1"></asp:Button></TD>
								<TD style="WIDTH: 94px; HEIGHT: 30px"></TD>
								<TD style="HEIGHT: 30px"></TD>
							</TR>
							<TR>
								<TD>&nbsp;
								</TD>
								<TD colspan="2" style="WIDTH: 202px"><asp:datagrid id="DataGrid1" runat="server" CssClass="griddatastyle" Width="551px" AutoGenerateColumns="false" BackColor="#6699cc" BorderColor="#cccccc">
										<alternatingitemstyle CssClass="GridAlternatingDataStyle"></alternatingitemstyle>
										<pagerstyle ForeColor="#FFFFFF" BackColor="#6699CC"></pagerstyle>
										<headerstyle HorizontalAlign="Left" Font-Size="8pt" ForeColor="White" BackColor="#6699CC" Wrap="False"></headerstyle>
										<itemstyle Font-Size="Smaller"></itemstyle>
										<columns>
											<asp:templatecolumn ItemStyle-Width="1%">
												<itemtemplate>
													<asp:checkbox ID="chk" runat="server" />
												</itemtemplate>
											</asp:templatecolumn>
                                            <asp:templatecolumn ItemStyle-Width="15%">
												<headertemplate>
													Action
												</headertemplate>
												<itemtemplate>
													<a href="javascript:void(0)" onclick="SelectThis('<%# DataBinder.Eval(Container.DataItem,"Name") %>');">Select</a>
												</itemtemplate>
											</asp:templatecolumn>
											<asp:boundcolumn Visible="false" DataField="Type" HeaderText="Type"></asp:boundcolumn>
											<asp:boundcolumn Visible="false" DataField="Name" HeaderText="HidName"></asp:boundcolumn>
											<asp:templatecolumn ItemStyle-Width="5%">
												<headertemplate>
												</headertemplate>
												<itemtemplate>
													<img width="50" height="50" src="<%# DataBinder.Eval(Container.DataItem,"FileIcon") %>"> 
												</itemtemplate>
											</asp:templatecolumn>
											<asp:templatecolumn ItemStyle-Width="50%">
												<headertemplate>
													Name
												</headertemplate>
												<itemtemplate>
													<asp:LinkButton id="LinkButton1" OnCommand="link_btn_Click" CommandName='<%# DataBinder.Eval(Container.DataItem,"Type") %>' CommandArgument='<%# DataBinder.Eval(Container.DataItem,"Name") %>' Text='<%# DataBinder.Eval(Container.DataItem,"Name") %>' runat="server" >LinkButton</asp:LinkButton></td>
												</itemtemplate>
											</asp:templatecolumn>
											<asp:templatecolumn ItemStyle-Width="15%">
												<headertemplate>
													Size
												</headertemplate>
												<itemtemplate>
													<%# DataBinder.Eval(Container.DataItem,"Size") %>   K  
												</itemtemplate>
											</asp:templatecolumn>
											<asp:boundcolumn HeaderText="Creation Time" DataField="CreationTime" SortExpression="CreationTime" ItemStyle-Width="15%" ItemStyle-Wrap="false"></asp:boundcolumn>
										</columns>
									</asp:datagrid>
								</TD>
								<TD></TD>
							</TR>
						</TABLE>
					</TD>
				</TR>
			</TABLE>
		</form>
	</body>
</HTML>
